package cn.itcast.com.Thread;

public class demo1 {
    public static void main(String[] args) {
        Mythread mythread = new Mythread();
        mythread.setName("nameThread");
        String name = mythread.getName();
        System.out.println(name+"1");
        mythread.start();

        String name1 = Thread.currentThread().getName();
        System.out.println(name1);

    }

    static class Mythread extends Thread{
        @Override
        public void run(){
                System.out.println(this.getName()+"2");

        }
    }
}
